#pragma once

/*
@author: TriLVH
@description: Bullet container to contain bullet fired by actor
*/

#include "BulletContainerData.h"
#include "BulletFactory.h"


class BulletContainer {
private:
	/* Bullet container data */
	BulletContainerData* _data;
	/* Check to kill bullet */
	bool _checkToKillBullet(BulletEntity* bullet);

public:
	void setMaxBullet(int max);

	/* Constructor to create bullet container*/
	BulletContainer(Rect* actorRect, BulletArmies bulletArmy);

	/* update container data for fire */
	void updateData(int distanceForLive, int delayOfTwoBullet, int maxBulletAtTheSame, int bulletType);

	/* Check can fire */
	bool checkCanFire();

	bool fire(double x, double y, int direction, Rect* targetRect, BulletBehavior* behavior);

	int getCurrentBulletType();

	/* fire bullet */
	BulletEntity* fire(double x, double y, int direction, Rect* targetRect);

	/* fire bullet */
	BulletEntity* fire(double x, double y, int direction, Rect* targetRect, bool isHalf);

	/* draw bullets */
	void draw(long time);

	/* update bullet */
	void update(long time);
};